package com.ruoyi.framework.web.exception.base;

/**
 * @author zhangjie
 * @version 2018-07-15
 * @apiNote 返回结果扩展类
 */
public class XResult {
    /**
     * 返回结果码[0：表示操作成功；403：表示操作失败；5：表示token验证失效]
     */
    private int code;
    /**
     * 返回的错误信息或成功提示
     */
    private String msg;
    /**
     * 返回的数据
     */
    private Object data;

    public XResult(String msg) {
        this.code = 403;
        this.msg = msg;
    }

    public XResult(String msg, Object data) {
        this.code = 200;
        this.msg = msg;
        this.data = data;
    }

    public XResult(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
